package com.golden.procedure.config;

import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;

import javax.sql.DataSource;

@Configuration
public class dbconfig {

    @Primary
    @Bean(name="dataSource-biz")
    @ConfigurationProperties(prefix = "db.datasource-biz")
    public DataSource bizDataSource() { return DataSourceBuilder.create().build();}

    @Bean(name="dataSource-user")
    @ConfigurationProperties(prefix = "db.datasource-user")
    public DataSource userDataSource() { return DataSourceBuilder.create().build();}
}
